<?php
/**
 * Created by PhpStorm.
 * User: hebidu
 * Date: 15/12/3
 * Time: 11:14
 */

namespace Test\Controller;

use Common\Api\BoyeServiceApi;
use Admin\Model\SecurityCodeModel;

class TestBbsAdditionsController extends TestController{


    public function index(){

        $this->display();
    }

    public function report(){
        if(IS_POST){
            $data = array(
                'fid' => I('post.fid'.''),
                'tid' => I('post.tid',''),
                'pid' => I('post.pid',''),
                'uid' => I('post.uid',''),
                'username' => I('post.username',''),
                'op_uid'=>I('post.op_uid',''),
                'api_ver'=>100,
                'notify_id'=>$this->notify_id,
                'type'=>'BY_CoreReport_bbsReport',
                'alg'=>'md5',
            );

            $service = new BoyeServiceApi();

            $result = $service->callRemote("",$data,True);

            $this->parseResult($result);
        }
        $this->display();
    }

    public function banUser(){
        if(IS_POST){
            $data = array(
                'admin_uid' => I('post.admin_uid'.''),
                'uid' => I('post.uid',''),
                'banned' => I('post.banned',''),
                'api_ver'=>100,
                'notify_id'=>$this->notify_id,
                'type'=>'BY_BbsAdminOper_banUser',
                'alg'=>'md5',
            );

            $service = new BoyeServiceApi();

            $result = $service->callRemote("",$data,True);

            $this->parseResult($result);
        }
        $this->display();
    }

    private function parseResult($result){
        echo "解密后数据：";
        dump($result);
    }


}